<?php

use think\migration\Migrator;
use app\model\CouponBrand;

class AlterCouponBrandIconData extends Migrator
{

    public function up()
    {
        CouponBrand::query()->select()->each(function (CouponBrand $couponBrand) {
            $couponBrand->icon = $couponBrand->image_url;
            $couponBrand->save();
        });
    }
}
